package com.winit.page.model;

import org.springframework.data.annotation.Transient;
import org.springframework.data.cassandra.mapping.Column;
import org.springframework.data.cassandra.mapping.PrimaryKey;
import org.springframework.data.cassandra.mapping.Table;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

@Table("matrix_page_element")
public class PageElement implements Serializable {
    @PrimaryKey
    @Column("id")
    private String id;
    @Column("ref_page_id")
    private String pageId;
    @Column("parent_id")
    private String parentId;
    @Column("ref_component_id")
    private String componentId;
    // 子element id列表(有序）
    @Column("children")
    private List<String> children;
    @Column("ref_master_config_id")
    private String masterConfigId;
    @Transient
    private Map<String, Object> attrs;
    @Transient
    private List<PageElement> childs;
    @Transient
    private Integer index;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPageId() {
        return pageId;
    }

    public void setPageId(String pageId) {
        this.pageId = pageId;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getComponentId() {
        return componentId;
    }

    public void setComponentId(String componentId) {
        this.componentId = componentId;
    }

    public List<String> getChildren() {
        return children;
    }

    public void setChildren(List<String> children) {
        this.children = children;
    }

    public String getMasterConfigId() {
        return masterConfigId;
    }

    public void setMasterConfigId(String masterConfigId) {
        this.masterConfigId = masterConfigId;
    }

    public Map<String, Object> getAttrs() {
        return attrs;
    }

    public void setAttrs(Map<String, Object> attrs) {
        this.attrs = attrs;
    }

    public List<PageElement> getChilds() {
        return childs;
    }

    public void setChilds(List<PageElement> childs) {
        this.childs = childs;
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }
}
